#!/bin/bash

# 获取 CPU 个数
cpu_count=$(grep -c '^processor' /proc/cpuinfo)

# 设置每个 CPU 的 scaling_governor
for ((i=0; i<cpu_count; i++))
do
    cpu_path="/sys/devices/system/cpu/cpu$i/cpufreq/scaling_governor"
    sudo bash -c "echo performance > $cpu_path"
done
